home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / wsc4d21.zip / WSC4D_R.TXT < prev    next >
Text File  |  1997-06-09  |  48KB  |  1,442 lines

  1.  
  2.  
  3.  
  4.                      Windows Standard Communications
  5.  
  6.                            Library for Delphi
  7.  
  8.                                  (WSC4D)
  9.  
  10.  
  11.                             REFERENCE MANUAL
  12.  
  13.  
  14.  
  15.                                Version 2.1
  16.  
  17.                                June 9, 1997
  18.  
  19.  
  20.  
  21.  
  22.                      This software is provided as-is.
  23.               There are no warranties, expressed or implied.
  24.  
  25.  
  26.  
  27.  
  28.                          Copyright (C) 1996-1997
  29.                            All rights reserved
  30.  
  31.  
  32.  
  33.                        MarshallSoft Computing, Inc.
  34.                            Post Office Box 4543
  35.                            Huntsville AL 35815
  36.  
  37.                            Voice : 205-881-4630
  38.                              FAX : 205|880|0925
  39.                              BBS : 205-880-9748
  40.                            email : info@marshallsoft.com
  41.                              web : www.marshallsoft.com
  42.  
  43.                                _______
  44.                           ____|__     |                (R)
  45.                        --+       |    +-------------------
  46.                          |   ____|__  |  Association of
  47.                          |  |       |_|  Shareware
  48.                          |__|   o   |    Professionals
  49.                        --+--+   |   +---------------------
  50.                             |___|___|    MEMBER
  51.  
  52.  
  53.       MARSHALLSOFT is a trademark of MarshallSoft Computing, Inc.
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.      WSC4D Reference Manual                                    Page 1
  61.  
  62.                             C O N T E N T S
  63.  
  64.  
  65.  
  66.         Chapter                                     Page
  67.  
  68.         Table of Contents.............................2
  69.  
  70.         WSC Functions.................................4
  71.  
  72.            SioBaud....................................4
  73.            SioBrkSig..................................4
  74.            SioCTS.....................................5
  75.            SioDCD.....................................5
  76.            SioDone....................................6
  77.            SioDSR.....................................6
  78.            SioDTR.....................................7
  79.            SioFlow....................................7
  80.            SioGetc....................................8
  81.            SioGets....................................8
  82.            SioInfo....................................9
  83.            SioParms...................................9
  84.            SioPutc...................................10
  85.            SioPuts...................................10
  86.            SioRead...................................11
  87.            SioReset..................................11
  88.            SioRI.....................................12
  89.            SioRTS....................................12
  90.            SioRxClear................................13
  91.            SioRxQue..................................13
  92.            SioStatus.................................14
  93.            SioTxClear................................14
  94.            SioTxQue..................................15
  95.            SioUnGetc.................................15
  96.            SioWinError...............................16
  97.  
  98.         WSC Error Codes..............................16
  99.  
  100.                          [continued next page]
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.      WSC4D Reference Manual                                    Page 2
  121.  
  122.                             C O N T E N T S
  123.  
  124.                               (continued)
  125.  
  126.  
  127.  
  128.         Chapter                                     Page
  129.  
  130.         Modem I/O Functions..........................17
  131.  
  132.            mioBreak..................................17
  133.            mioDriver.................................17
  134.            mioQuiet..................................18
  135.            mioResult.................................18
  136.            mioSendTo.................................19
  137.            mioWaitFor................................19
  138.  
  139.         XYDRIVER Functions...........................20
  140.  
  141.            xyAbort...................................20
  142.            xyAcquire.................................20
  143.            xyDebug...................................21
  144.            xyDriver..................................21
  145.            xyGetMessage..............................22
  146.            xyGetParameter............................22
  147.            xyRelease.................................23
  148.            xyStartRx.................................23
  149.            xyStartTx.................................24
  150.  
  151.         XYDRIVER Error Codes.........................24
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.      WSC4D Reference Manual                                    Page 3
  181.  
  182.       +-------------+-----------------------------------------------------+
  183.       |   SioBaud   |  Sets the baud rate.                                |
  184.       +-------------+-----------------------------------------------------+
  185.  
  186.  
  187.       SYNTAX function SioBaud(Port,BaudCode:Integer):Integer;
  188.              (* Port     : Port selected. *)
  189.              (* BaudCode : Baud code or actual baud rate. *)
  190.  
  191.       REMARK The SioBaud function sets the baud rate without resetting
  192.              the port. It is used to change the baud rate after calling
  193.              SioReset.
  194.  
  195.              SioBaud may be called with either the actual baud rate value
  196.              or one of the baud rate codes as follows:
  197.  
  198.                Code   Rate    Name             Code   Rate   Name
  199.                  0     300    Baud300            5    9600   Baud9600
  200.                  1     600    Baud600            6   19200   Baud19200
  201.                  2    1200    Baud1200           7   38400   Baud38400
  202.                  3    2400    Baud2400           8   57600   Baud57600
  203.                  4    4800    Baud4800           9  115200   Baud115200
  204.  
  205.       RETURN    IE_BADID : No such port.
  206.              IE_BAUDRATE : Unsupported baud rate.
  207.  
  208.        OTHER See SioReset.
  209.  
  210.  
  211.  
  212.       +-------------+-----------------------------------------------------+
  213.       |  SioBrkSig  |  Asserts, cancels, or detects BREAK signal.         |
  214.       +-------------+-----------------------------------------------------+
  215.  
  216.       SYNTAX function SioBrkSig(Port:Integer;Cmd:Char):Integer;
  217.              (* Port : Port selected. *)
  218.              (* Cmd  : ASSERT, CANCEL, or DETECT. *)
  219.  
  220.       REMARK The SioBrkSig function controls the BREAK bit in the line
  221.              status register. The legal commands are:
  222.  
  223.              ASSERT_BREAK : 'A' to assert BREAK
  224.              CANCEL_BREAK : 'C' to cancel BREAK
  225.              DETECT_BREAK : 'D' to detect BREAK
  226.  
  227.              ASSERT_BREAK, CANCEL_BREAK, and DETECT_BREAK are defined in
  228.              WSC4D.PAS. See MODEM.C for an example of the use of SioBrkSig.
  229.  
  230.       RETURN  IE_NOPEN : Port not opened. Call SioReset first.
  231.               IE_BADID : No such port.
  232.              WSC_RANGE : Illegal command. Expected 'A', 'C', or 'D'.
  233.                     >0 : BREAK signal detected (DETECT command only)
  234.  
  235.        OTHER See SioBrkKey.
  236.  
  237.  
  238.  
  239.  
  240.      WSC4D Reference Manual                                    Page 4
  241.  
  242.       +-------------+-----------------------------------------------------+
  243.       |   SioCTS    |  Reads the Clear to Send (CTS) modem status bit.    |
  244.       +-------------+-----------------------------------------------------+
  245.  
  246.       SYNTAX function SioCTS(Port:Integer):Integer;
  247.              (* Port : Port selected. *)
  248.  
  249.       REMARK The SioCTS function is used to detect if CTS (Clear To Send)
  250.              is set (1) or clear (0). Some Windows Win16 COMM drivers
  251.              cannot read the CTS bit correctly!
  252.  
  253.              The CTS line is used by some error correcting modems to
  254.              implement hardware flow control.  CTS is dropped by the modem
  255.              to signal the computer not to send data and is raised to
  256.              signal the computer to continue.
  257.  
  258.              Refer to the User's Manual for a discussion of flow control.
  259.  
  260.       RETURN IE_NOPEN : Port not opened. Call SioReset first.
  261.              IE_BADID : No such port.
  262.                     0 : CTS has not changed.
  263.                    >0 : CTS has changed.
  264.  
  265.        OTHER See SioFlow, SioDSR, SioRI, SioDCD, and SioModem.
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.       +-----------+-------------------------------------------------------+
  281.       |  SioDCD   |  Reads the Data Carrier Detect (DCD) modem status bit.|
  282.       +-----------+-------------------------------------------------------+
  283.  
  284.       SYNTAX function SioDCD(Port:Integer):Integer;
  285.              (* Port : Port selected. *)
  286.  
  287.       REMARK The SioDCD function is used to read the Data Carrier Detect
  288.              (DCD) modem status bit. Also see SioModem.
  289.  
  290.       RETURN IE_NOPEN : Port not opened. Call SioReset first.
  291.              IE_BADID : No such port.
  292.                     0 : DCD is clear.
  293.                    >0 : DCD is set.
  294.  
  295.        OTHER See SioDSR, SioCTS, SioRI, and SioModem.
  296.  
  297.  
  298.  
  299.  
  300.      WSC4D Reference Manual                                    Page 5
  301.  
  302.       +-------------+-----------------------------------------------------+
  303.       |   SioDone   |  Terminates further serial processing.              |
  304.       +-------------+-----------------------------------------------------+
  305.  
  306.       SYNTAX function SioDone(Port:Integer):Integer;
  307.              (* Port : Port selected. *)
  308.  
  309.       REMARK The SioDone function terminates further serial processing,
  310.              allowing other applications to use the port.
  311.  
  312.       RETURN IE_NOPEN : Port not opened. Call SioReset first.
  313.              IE_BADID : No such port.
  314.  
  315.        OTHER See SioReset.
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.       +-------------+-----------------------------------------------------+
  326.       |    SioDSR   |  Reads the Data Set Ready (DSR) modem status bit.   |
  327.       +-------------+-----------------------------------------------------+
  328.  
  329.       SYNTAX function SioDSR(Port:Integer):Integer;
  330.              (* Port : Port selected. *)
  331.  
  332.       REMARK The SioDSR function is used to detect if DSR (Data Set Ready)
  333.              is set (1) or clear (0). Some Windows Win16 COMM drivers
  334.              cannot read the DSR bit correctly!
  335.  
  336.       RETURN IE_NOPEN : Port not opened. Call SioReset first.
  337.              IE_BADID : No such port.
  338.                     0 : DSR has not changed.
  339.                    >0 : DSR has changed.
  340.  
  341.        OTHER See SioCTS, SioRI, and SioDCD.
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.      WSC4D Reference Manual                                    Page 6
  361.  
  362.       +-------------+-----------------------------------------------------+
  363.       |    SioDTR   |  Set, clear, or read Data Terminal Ready (DTR).     |
  364.       +-------------+-----------------------------------------------------+
  365.  
  366.       SYNTAX function SioDTR(Port:Integer;Cmd:Char):Integer;
  367.              (* Port : Port selected. *)
  368.              (* Cmd  : DTR command (see below). *)
  369.  
  370.       REMARK The SioDTR function controls the Data Terminal Ready (DTR) bit
  371.              in the modem control register.  DTR should always be set when
  372.              communicating with a modem.  Commands (defined in WSC4D.PAS):
  373.  
  374.                   SET_LINE   : 'S'  to set DTR (ON)
  375.                   CLEAR_LINE : 'C'  to clear DTR (OFF)
  376.                   READ_LINE  : 'R'  to read DTR
  377.  
  378.       RETURN IE_NOPEN  : Port not opened. Call SioReset first.
  379.              IE_BADID  : No such port.
  380.              WSC_RANGE : Not one of 'S', 'C', or 'R'.
  381.                      0 : DTR is OFF (READ_LINE Command).
  382.                     >0 : DTR is ON (READ_LINE Command).
  383.  
  384.        OTHER See SioRTS.
  385.  
  386.       +------------+------------------------------------------------------+
  387.       |   SioFlow  |  Sets hardware (RTS/CTS) flow control.               |
  388.       +------------+------------------------------------------------------+
  389.  
  390.       SYNTAX function SioFlow(Port:Integer;Cmd:Char):Integer;
  391.              (* Port : Port selected. *)
  392.              (* Cmd  : Class of flow control (see below). *)
  393.  
  394.       REMARK The SioFlow function is used to enable or disable hardware
  395.              flow control.  Hardware flow control uses RTS and CTS to
  396.              control data flow between the modem and the computer.  To
  397.              enable flow control, call SioFlow with Cmd set to:
  398.  
  399.                     Cmd     Flow Control
  400.                   'H'  Hardware (RTS/CTS) flow control.
  401.                   'S'  Software (XON/XOFF) flow control.
  402.                   'N'  No flow control.
  403.  
  404.              In order for hardware flow control to work correctly, your
  405.              modem must also be configured to work with hardware flow
  406.              control, and your computer to modem cable must have RTS and
  407.              CTS wired straight through. If you enable hardware flow
  408.              control, do not modify the RTS line (by calling SioRTS). Flow
  409.              control is disabled after resetting a port.
  410.  
  411.       RETURN IE_NOPEN : Port not opened. Call SioReset first.
  412.              IE_BADID : No such port.
  413.             WSC_RANGE : Cannot recognize Cmd.
  414.                   -1  : Flow control disabled.
  415.                   >0  : Flow control enabled.
  416.  
  417.        OTHER See SioPutc
  418.  
  419.  
  420.      WSC4D Reference Manual                                    Page 7
  421.  
  422.       +------------+------------------------------------------------------+
  423.       |   SioGetc  |  Reads the next character from the serial line.      |
  424.       +------------+------------------------------------------------------+
  425.  
  426.       SYNTAX function SioGetc(Port:Integer)
  427.              (* Port : Port selected. *)
  428.  
  429.       REMARK The SioGetc function reads a byte from the selected serial
  430.              port. WSC_NO_DATA (-100) is returned if no byte is available.
  431.  
  432.  
  433.       RETURN    IE_NOPEN : Port not opened. Call SioReset first.
  434.                 IE_BADID : No such port.
  435.              WSC_NO_DATA : If timed out (no data available).
  436.                     >= 0 : Character read.
  437.  
  438.        OTHER See SioUnGetc and SioGets.
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.       +------------+------------------------------------------------------+
  448.       |   SioGets  |  Reads the next byte buffer from the serial line.    |
  449.       +------------+------------------------------------------------------+
  450.  
  451.       SYNTAX function SioGetc(Port:Integer,String:PChar;
  452.                                 Cnt:Integer):Integer;
  453.              (* Port   : Port selected. *)
  454.              (* Buffer : Receive buffer. *)
  455.              (* Cnt    : Number bytes wanted. *)
  456.  
  457.       REMARK The SioGets function reads the smaller of the number of bytes
  458.              wanted (Cnt) and the number of bytes in the receive buffer. A
  459.              zero is return if no bytes are read.
  460.  
  461.  
  462.       RETURN IE_NOPEN : Port not opened. Call SioReset first.
  463.              IE_BADID : No such port.
  464.                  >= 0 : Number of characters actually read.
  465.  
  466.        OTHER See SioUnGetc and SioPutc.
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.      WSC4D Reference Manual                                    Page 8
  481.  
  482.       +-------------+-----------------------------------------------------+
  483.       |   SioInfo   |  Returns WSC4D library information.                 |
  484.       +-------------+-----------------------------------------------------+
  485.  
  486.       SYNTAX function SioInfo(Cmd:Integer):Integer;
  487.              (* Cmd : Command (See below). *)
  488.  
  489.       REMARK The SioInfo function returns an integer code corresponding to
  490.              the Cmd as follows.
  491.  
  492.                   Command   SioInfo returns
  493.                     'V'     Library version number.
  494.                     '?'     Number of seconds until expiration.
  495.  
  496.              The '?' command can be used in the shareware version to find
  497.              the number of seconds left before the executable expires,
  498.              after which the application must be restarted. This function
  499.              only has meaning in the SHAREWARE version of WSC.
  500.  
  501.       RETURN See remarks above.
  502.              -1 : Cannot recognize Cmd.
  503.  
  504.  
  505.  
  506.  
  507.       +-------------+-----------------------------------------------------+
  508.       |  SioParms   |  Sets parity, stop bits, and word length.           |
  509.       +-------------+-----------------------------------------------------+
  510.  
  511.  
  512.       SYNTAX function SioParms(Port,Parity,StopBits,
  513.                                  DataBits:Integer):Integer;
  514.              (* Port     : Port selected. *)
  515.              (* Parity   : Parity code [0,1,2]. *)
  516.              (* StopBits : Stop bits code [0,1]. *)
  517.              (* DataBits : Word length code [0,1,2,3]. *)
  518.  
  519.       REMARK The SioParms function sets the parity, stop bits, and word
  520.              length.  If the default parity (none), stop bits (1), or word
  521.              length (8) is not acceptable, then they can be changed by
  522.              calling SioParms.  SioParms can be called either before or
  523.              after calling SioReset. See file WSC4D.PAS.
  524.  
  525.              Use the constant values defined in WSC4D.PAS to minimize the
  526.              chance of passing an incorrect parameter value.
  527.  
  528.                Parity : NoParity, OddParity, EvenParity.
  529.              StopBits : OneStopBit, TwoStopBits.
  530.              DataBits : WordLength7, WorldLength8.
  531.  
  532.       RETURN    IE_BADID : No such port.
  533.              IE_BYTESIZE : Word length not supported.
  534.                WSC_RANGE : Parameter out of range.
  535.  
  536.        OTHER See SioReset.
  537.  
  538.  
  539.  
  540.      WSC4D Reference Manual                                    Page 9
  541.  
  542.       +-------------+-----------------------------------------------------+
  543.       |   SioPutc   |  Transmit a character over a serial line.           |
  544.       +-------------+-----------------------------------------------------+
  545.  
  546.       SYNTAX function SioPutc(Port:Integer;Ch:Char):Integer;
  547.              (* Port : Port selected. *)
  548.              (* Ch   : Character to send. *)
  549.  
  550.       REMARK The SioPutc function copies the character to the transmit
  551.              queue for subsequent transmission.
  552.  
  553.       RETURN IE_NOPEN : Port not opened. Call SioReset first.
  554.              IE_BADID : No such port.
  555.                     0 : No error.
  556.  
  557.        OTHER See SioGetc and SioFlow.
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.       +-------------+-----------------------------------------------------+
  567.       |   SioPuts   |  Transmits a byte buffer over a serial line.        |
  568.       +-------------+-----------------------------------------------------+
  569.  
  570.       SYNTAX function SioPuts(Port:Integer;String:PChar;
  571.                                 Cnt:Integer):Integer;
  572.              (* Port   : Port selected. *)
  573.              (* Buffer : String of bytes to transmit. *)
  574.  
  575.       REMARK The SioPuts function copies the characters to the transmit
  576.              queue for subsequent transmission.
  577.  
  578.  
  579.       RETURN IE_NOPEN : Port not opened. Call SioReset first.
  580.              IE_BADID : No such port.
  581.                  >= 0 : The number of bytes actually transmitted.
  582.  
  583.        OTHER See SioGetc and SioFlow.
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.      WSC4D Reference Manual                                    Page 10
  601.  
  602.       +-------------+-----------------------------------------------------+
  603.       |   SioRead   |  Reads any UART register.                           |
  604.       +-------------+-----------------------------------------------------+
  605.  
  606.       SYNTAX function SioRead(Port, Reg : Integer) : Integer;
  607.              (* Port : Port selected. *)
  608.              (* Reg : UART register (0 to 7). *)
  609.  
  610.       REMARK The SioRead function reads any of the 7 I/O ports directly,
  611.              by-passing the Windows API.
  612.  
  613.              Note that all modem and/or line status bits can also be read
  614.              using SioDTR, SioRTS, SioDCD, SioRI, SioDSR, and SioCTS. Refer
  615.              to the User's Manual for a description of the UART registers.
  616.  
  617.       RETURN IE_NOPEN : Port not opened. Call SioReset first.
  618.              IE_BADID : No such port.
  619.                    >0 : Contents of selected UART register.
  620.  
  621.        OTHER See SioStatus.
  622.  
  623.  
  624.  
  625.       +-------------+-----------------------------------------------------+
  626.       |  SioReset   |  Initialize a serial port for processing.           |
  627.       +-------------+-----------------------------------------------------+
  628.  
  629.       SYNTAX function SioReset(Port,RxQueSize,TxQueSize:Integer):Integer;
  630.              (* Port      : Port selected. *)
  631.              (* RxQueSize : Receive queue size. *)
  632.              (* TxQueSize : Transmit queue size. *)
  633.  
  634.       REMARK The SioReset function initializes the selected serial port.
  635.              SioReset should be called before making any other calls to
  636.              WSC4D.  SioReset uses the parity, stop bits, and word length
  637.              value previously set if SioParms was called, otherwise the
  638.              default values (see SioParm) are used.
  639.  
  640.       RETURN    IE_BADID : No such port.
  641.                  IE_OPEN : Already open.
  642.                IE_MEMORY : Cannot allocate memory.
  643.              IE_HARDWARE : Hardware error.
  644.  
  645.        OTHER See SioBaud, SioParms, and SioDone.
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.      WSC4D Reference Manual                                    Page 11
  661.  
  662.       +-------------+-----------------------------------------------------+
  663.       |    SioRI    |  Reads the Ring Indicator (RI) modem status bit.    |
  664.       +-------------+-----------------------------------------------------+
  665.  
  666.       SYNTAX function SioRI(Port:Integer)
  667.              (* Port : Port selected. *)
  668.  
  669.       REMARK The SioRI function is used to read the Ring Indicator (RI)
  670.              modem status bit.
  671.  
  672.       RETURN IE_NOPEN : Port not opened. Call SioReset first.
  673.              IE_BADID : No such port.
  674.                     0 : RI is clear.
  675.                    >0 : RI is set (RING has occurred).
  676.  
  677.        OTHER See SioDSR, SioCTS, and SioDCD.
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.       +-------------+-----------------------------------------------------+
  685.       |    SioRTS   |  Sets, clears, or reads the Request to Send (RTS).  |
  686.       +-------------+-----------------------------------------------------+
  687.  
  688.       SYNTAX function SioRTS(Port:Integer;Cmd:Integer):Integer;
  689.              (* Port : Port selected. *)
  690.              (* Cmd  : RTS command (SET, CLEAR, or READ). *)
  691.  
  692.       REMARK The SioRTS function controls the Request to Send (RTS bit in
  693.              the modem control register.
  694.  
  695.              The RTS line is used by some error correcting modems to
  696.              implement hardware flow control.  RTS is dropped by the
  697.              computer to signal the modem not to send data, and is raised
  698.              to signal the modem to continue. RTS should be set when
  699.              communicating with a modem unless Flow Control is being used.
  700.  
  701.              Refer to the User's Manual for a discussion of flow control.
  702.              Commands (defined in WSC4D.PAS) are:
  703.  
  704.                     SET_LINE  'S' : set RTS (ON)
  705.                   CLEAR_LINE  'C' : clear RTS (OFF)
  706.                    READ_LINE  'R' : read RTS
  707.  
  708.       RETURN  IE_NOPEN : Port not opened. Call SioReset first.
  709.               IE_BADID : No such port.
  710.              WSC_RANGE : Command is not one of 'S', 'C', or 'R'.
  711.                      0 : RTS is OFF ('R' command).
  712.                     >0 : RTS is ON  ('R' command).
  713.  
  714.        OTHER See SioFlow and SioDTR.
  715.  
  716.  
  717.  
  718.  
  719.  
  720.      WSC4D Reference Manual                                    Page 12
  721.  
  722.       +------------+------------------------------------------------------+
  723.       | SioRxClear |  Clears the receive buffer.                          |
  724.       +------------+------------------------------------------------------+
  725.  
  726.       SYNTAX function SioRxClear(Port:Integer)
  727.              (* Port : Port selected. *)
  728.  
  729.       REMARK The SioRxClear function will delete any characters in the
  730.              receive buffer for the specified port.  After execution, the
  731.              receive buffer will be empty.
  732.  
  733.       RETURN IE_NOPEN : Port not opened. Call SioReset first.
  734.              IE_BADID : No such port.
  735.  
  736.        OTHER See SioRxQue.
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.       +-------------+-----------------------------------------------------+
  747.       |  SioRxQue   |  Returns the number of bytes in the receive queue.  |
  748.       +-------------+-----------------------------------------------------+
  749.  
  750.       SYNTAX function SioRxQue(Port:Integer)
  751.              (* Port : Port selected. *)
  752.  
  753.       REMARK The SioRxQue function will return the number of characters in
  754.              the receive queue at the time of the call.
  755.  
  756.       RETURN IE_NOPEN : Port not opened. Call SioReset first.
  757.              IE_BADID : No such port.
  758.  
  759.        OTHER See SioRxFlush.
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.      WSC4D Reference Manual                                    Page 13
  781.  
  782.       +------------+------------------------------------------------------+
  783.       | SioStatus  |  Returns the serial port status.                     |
  784.       +------------+------------------------------------------------------+
  785.  
  786.       SYNTAX function SioStatus(Port:Integer;Mask:Word):Integer;
  787.              (* Port : Port selected. *)
  788.              (* Mask : Error mask. *)
  789.  
  790.       REMARK The SioStatus function returns the serial port error status
  791.              corresponding to the Mask argument.
  792.  
  793.                 WSC_RXOVER  : The receive queue overflowed.
  794.                 WSC_OVERRUN : An incoming byte was overwritten.
  795.                  WSC_PARITY : A parity error was detected (incoming byte)
  796.                   WSC_FRAME : A framing error was detected (incoming byte)
  797.                   WSC_BREAK : A break signal was detected.
  798.                  WSC_TXFULL : The transmit queue is full.
  799.  
  800.              For example, to test for receive queue overflow:
  801.  
  802.                 if(SioStatus(Port, WSC_RXOVER)) printf(.RX Overflow.);
  803.  
  804.              The numerical values of the mask constants are defined in
  805.              WSC4D.PAS.
  806.  
  807.       RETURN IE_NOPEN : Port not opened. Call SioReset first.
  808.              IE_BADID : No such port.
  809.  
  810.  
  811.  
  812.  
  813.       +------------+------------------------------------------------------+
  814.       | SioTxClear |  Clears the transmitter buffer.                      |
  815.       +------------+------------------------------------------------------+
  816.  
  817.       SYNTAX function SioTxClear(Port:Integer)
  818.              (* Port : Port selected. *)
  819.  
  820.       REMARK The SioTxClear function will delete any characters in the
  821.              transmit buffer for the specified port.
  822.  
  823.              Once this function is called, any character in the transmit
  824.              buffer (put there by SioPutc) will be lost and therefore not
  825.              transmitted.
  826.  
  827.       RETURN IE_NOPEN : Port not opened. Call SioReset first.
  828.              IE_BADID : No such port.
  829.  
  830.        OTHER See SioTxQue & SioTxFlush.
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.      WSC4D Reference Manual                                    Page 14
  841.  
  842.       +------------+------------------------------------------------------+
  843.       |  SioTxQue  |  Returns the number of bytes in the transmit queue.  |
  844.       +------------+------------------------------------------------------+
  845.  
  846.       SYNTAX function SioTxQue(Port:Integer)
  847.              (* Port : Port selected. *)
  848.  
  849.       REMARK The SioTxQue function will return the number of characters in
  850.              the transmit queue at the time of the call.
  851.  
  852.       RETURN IE_NOPEN : Port not opened. Call SioReset first.
  853.              IE_BADID : No such port.
  854.  
  855.        OTHER See SioTxFlush.
  856.  
  857.  
  858.  
  859.  
  860.  
  861.       +------------+------------------------------------------------------+
  862.       | SioUnGetc  |  "Ungets" the last character read with SioGetc().    |
  863.       +------------+------------------------------------------------------+
  864.  
  865.       SYNTAX function SioUnGetc(Port:Integer;Ch:Char):Integer;
  866.              (* Port : Port selected. *)
  867.              (* Ch   : Character to unget. *)
  868.  
  869.       REMARK The SioUnGetc function returns (pushes) the character back
  870.              into the serial input buffer.  The character pushed will be
  871.              the next character returned by SioGetc.  Only one character
  872.              can be pushed back. This function works just like the
  873.              "ungetc" function in the C language.
  874.  
  875.       RETURN IE_NOPEN : Port not opened. Call SioReset first.
  876.              IE_BADID : No such port.
  877.  
  878.        OTHER See SioReset.
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.      WSC4D Reference Manual                                    Page 15
  901.  
  902.       +-------------+-----------------------------------------------------+
  903.       | SioWinError |  Return Win32 system error. [WIN32 ONLY]            |
  904.       +-------------+-----------------------------------------------------+
  905.  
  906.       SYNTAX function SioWinError(Buffer:PChar; Size:Integer):Integer;
  907.              (* Buffer : Text buffer to receive formatted Win32 error *)
  908.              (* Size   : Size of above *)
  909.  
  910.       REMARK The SioWinError function returns the Win32 system error code
  911.              and error text for the last Win32 error. Call this function
  912.              immediately after getting WSC_WIN32ERR from one of the WSC
  913.              functions. Defined for WIN32 only.
  914.  
  915.              See the DisplayError function in DISPLAY.PAS for an example of
  916.              use.
  917.  
  918.       RETURN The Win32 error number.
  919.  
  920.        OTHER See SioReset.
  921.  
  922.  
  923.  
  924.                           WSC Error Codes
  925.  
  926.  
  927.       +---------------+---------------------------------------------+
  928.       |  WSC_NO_DATA  |  No incoming serial data is available.      |
  929.       |  WSC_RANGE    |  A parameter is out of range.               |
  930.       |  WSC_ABORTED  |  The shareware version of WSC corrupted.    |
  931.       |  WSC_WIN32ERR |  Win32 system error.                        |
  932.       |  WSC_EXPIRED  |  The shareware version of WSC has expired.  |
  933.       +---------------+---------------------------------------------+
  934.       |  IE_BADID     |  No such port.                              |
  935.       |  IE_OPEN      |  Port already opened.                       |
  936.       |  IE_NOPEN     |  Port not opened. Call SioReset first.      |
  937.       |  IE_MEMORY    |  Cannot allocate memory for queues.         |
  938.       |  IE_DEFAULT   |  Error in default parameters.               |
  939.       |  IE_HARDWARE  |  Hardware not present.                      |
  940.       |  IE_BYTESIZE  |  Unsupported byte size.                     |
  941.       |  IE_BAUDRATE  |  Unsupported baud rate.                     |
  942.       +---------------+---------------------------------------------+
  943.  
  944.       The WSC_EXPIRED error occurs when in the shareware DLL only. It
  945.       limits the execution of an WSC DLL to 10 minutes of execution. The
  946.       application must be restarted to continue serial processing.
  947.  
  948.       The WSC_ABORTED error occurs in the shareware version only if there
  949.       is a problem displaying the shareware screen.
  950.  
  951.       The WSC_WIN32ERR error code is returned only for Win32 system errors.
  952.       Call SioWinError to format the textual error message.
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.      WSC4D Reference Manual                                    Page 16
  961.  
  962.       +-----------+-------------------------------------------------------+
  963.       | mioBreak  |  Aborts the Modem I/O state driver.                   |
  964.       +-----------+-------------------------------------------------------+
  965.  
  966.       SYNTAX function mioBreak(Port:Integer):Integer;
  967.              (* Port : Port selected. *)
  968.  
  969.       REMARK Forces the MIO driver to the IDLE state, abandoning any work
  970.              in progress (if any). Used to abort mioSendTo, mioQuiet, and
  971.              mioWaitFor functions.
  972.  
  973.       RETURN MIO_IDLE.
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.       +------------+------------------------------------------------------+
  982.       | mioDriver  |  Modem I/O state driver.                             |
  983.       +------------+------------------------------------------------------+
  984.  
  985.       SYNTAX function mioDriver(Port:Integer):Integer;
  986.              (* Port : Port selected. *)
  987.  
  988.       REMARK Executes the next state of any previously started MIO function
  989.              such as mioSendTo, mioWaitFor, and mioQuiet. Returns MIO_IDLE
  990.              (defined in MIO.PAS) if ready not running, MIO_RUNNING if
  991.              running, and anything else is a character from the modem that
  992.              can be displayed if wanted.
  993.  
  994.       RETURN  MIO_IDLE : if the driver is ready for the next mioSendTo,
  995.                            mioWaitFor, or mioQuiet.
  996.              MIO_RUNNING : if the driver is not idle.
  997.                   <else> : if the driver is not idle, and the returned
  998.                            character was received from the modem.
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.      WSC4D Reference Manual                                    Page 17
  1021.  
  1022.       +-----------+-------------------------------------------------------+
  1023.       | mioQuiet  |  Waits for Modem I/O state driver.                    |         *
  1024.       +-----------+-------------------------------------------------------+
  1025.  
  1026.       SYNTAX function mioQuiet(Port:Integer;Wait:LongInt):Integer;
  1027.              (* Port : Port selected. *)
  1028.              (* Wait : Wait in milliseconds. *)
  1029.  
  1030.       REMARK The mioQuiet function waits for continuous quiet [no incoming
  1031.              serial data] of 'Wait' milliseconds before returning.  Any
  1032.              incoming character while mioQuiet is running is lost.
  1033.  
  1034.       RETURN TRUE.
  1035.  
  1036.  
  1037.  
  1038.  
  1039.       +------------+------------------------------------------------------+
  1040.       | mioResult  |  Returns result of last mioWaitFor.                  |
  1041.       +------------+------------------------------------------------------+
  1042.  
  1043.       SYNTAX function mioResult(Port:Integer):Integer;
  1044.              (* Port : Port selected. *)
  1045.  
  1046.       REMARK The mioResult function returns the result of the last
  1047.              mioWaitFor function. This function should not be called until
  1048.              the driver returns MIO_IDLE. See the remarks section of the
  1049.              mioWaitFor function for an example.
  1050.  
  1051.       RETURN  0 : False (last WaitFor not matched)
  1052.              !0 : '0' if first substring matched, '1' if second substring
  1053.              matched, etc.
  1054.  
  1055.        OTHER See mioWaitFor.
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.      WSC4D Reference Manual                                    Page 18
  1081.  
  1082.       +-----------+-------------------------------------------------------+
  1083.       | mioSendTo |  Sends string to modem.                               |
  1084.       +-----------+-------------------------------------------------------+
  1085.  
  1086.       SYNTAX function mioSendTo(Port:Integer;Pace:LongInt:
  1087.                                   String:PChar):Integer;
  1088.              (* Port : Port selected. *)
  1089.              (* Pace : The inter-character delay in milliseconds. *)
  1090.              (* String : The string to send. *)
  1091.  
  1092.       REMARK The mioSendTo function sends the characters in the string
  1093.              'Text' to serial output. There is a delay of 'Pace'
  1094.              milliseconds between characters.
  1095.  
  1096.       RETURN TRUE.
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.       +-------------+-----------------------------------------------------+
  1103.       | mioWaitFor  |  Waits for continuous quiet.                        |
  1104.       +-------------+-----------------------------------------------------+
  1105.  
  1106.       SYNTAX function mioWaitFor(Port:Integer;Wait:LongInt;
  1107.                         String:PChar):Integer;
  1108.  
  1109.              (* Port : Port selected. *)
  1110.              (* Wait : Total time to wait for response (milliseconds). *)
  1111.              (* String : The expected response string. *)
  1112.  
  1113.       REMARK The mioWaitFor function waits for characters from serial
  1114.              input that match the string 'Text'. A total of 'Wait'
  1115.              milliseconds are allowed before timing out and returning FALSE
  1116.              (0). The string comparison is NOT case sensitive.
  1117.  
  1118.              For example, to wait up to one minute for 'CONNECT', 'NO
  1119.              CARRIER', or 'BUSY' from the modem after dialing a number.
  1120.  
  1121.              Code = mioWaitFor(Port,60000,'CONNECT|NO CARRIER|BUSY')
  1122.  
  1123.              The function mioDriver() must be called until MIO_IDLE is
  1124.              returned. Then mioResult() is called to get the result of the
  1125.              mioWaitFor.  A value of 0 indicates that neither 'CONNECT',
  1126.              'BUSY', nor 'NO CARRIER' was received. A non-zero value
  1127.              indicates that one of the three sub-strings was received.  A
  1128.              '0' is returned if 'CONNECT' was seen, '1' is returned if 'NO
  1129.              CARRIER' was seen, and '2' is returned if 'BUSY' was seen.
  1130.  
  1131.       RETURN TRUE.
  1132.  
  1133.        OTHER See mioResult.
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.      WSC4D Reference Manual                                    Page 19
  1141.  
  1142.       +---------+---------------------------------------------------------+
  1143.       | xyAbort | Aborts the XYDRIVER state driver.                       |
  1144.       +---------+---------------------------------------------------------+
  1145.  
  1146.       SYNTAX function xyAbort(Port:Integer):Integer;
  1147.              (* Port :  Port selected. *)
  1148.  
  1149.       REMARK The xyAbort function forces the driver to IDLE, terminating
  1150.              any file transfer which may be in progress.
  1151.  
  1152.       RETURN XY_NO_ERROR (0).
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.       +-----------+-------------------------------------------------------+
  1160.       | xyAcquire | Prepares the state driver for operation.              |
  1161.       +-----------+-------------------------------------------------------+
  1162.  
  1163.       SYNTAX function xyAcquire(Port:Integer):Integer;
  1164.              (* Port :  Port selected. *)
  1165.  
  1166.  
  1167.       REMARK The xyAcquire function initializes the driver for subsequent
  1168.              use. This should be the first driver function called.
  1169.  
  1170.       RETURN =0 : No error (XY_NO_ERROR).
  1171.              <0 : XYDRIVER error. See .XYDRIVER Error Codes..
  1172.  
  1173.        OTHER See xyRelease.
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.      WSC4D Reference Manual                                    Page 20
  1201.  
  1202.       +----------+--------------------------------------------------------+
  1203.       | xyDebug  | Set the driver debug level.                            |
  1204.       +----------+--------------------------------------------------------+
  1205.  
  1206.       SYNTAX function xyDebug(DebugLevel:Integer):Integer;
  1207.              (* DebugLevel : Debug level value. *)
  1208.  
  1209.       REMARK The xyDebug functions sets the driver debug level as follows:
  1210.  
  1211.              DebugLevel :  Meaning
  1212.                  0         Only error messages are generated [default].
  1213.                  1         Minimal debug messages are generated.
  1214.                  2         Maximal debug messages are generated.
  1215.  
  1216.              Debug messages are retrieved using the xyGetMessage function.
  1217.  
  1218.       RETURN New debug level [0,1,2]
  1219.  
  1220.  
  1221.  
  1222.  
  1223.       +----------+--------------------------------------------------------+
  1224.       | xyDriver | XMODEM / YMODEM state driver.                          |
  1225.       +----------+--------------------------------------------------------+
  1226.  
  1227.       SYNTAX function xyDriver(Port:Integer):Integer;
  1228.              (* Port :  Port selected. *)
  1229.  
  1230.       RETURN    XY_IDLE : A transfer is not underway.
  1231.              XY_RUNNING : A transfer is underway.
  1232.  
  1233.       REMARK The xyDriver function drives the state engine. It is normally
  1234.              called within a timer loop. Note that xyDriver never returns
  1235.              an error code.
  1236.  
  1237.              xyDriver can be called as often as wanted whether or not a
  1238.              file transfer was initiated.
  1239.  
  1240.        OTHER See xyStartTx and xyStartRx.
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.      WSC4D Reference Manual                                    Page 21
  1261.  
  1262.       +--------------+----------------------------------------------------+
  1263.       | xyGetMessage |  Get next XYDRIVER message.                        |
  1264.       +--------------+----------------------------------------------------+
  1265.  
  1266.       SYNTAX function xyGetMessage(Buffer:PChar;Size:Integer):Integer;
  1267.              (* Buffer : Message buffer. *)
  1268.              (* Size   : Size of message buffer. *)
  1269.  
  1270.       REMARK The xyGetMessage function retieves the next message from the
  1271.              driver message queue. Refer to the TERM.C example program for
  1272.              an example of using xyGetMessage.
  1273.  
  1274.       RETURN  TRUE : A message was copied into Buffer.
  1275.              FALSE : No messages are available.
  1276.  
  1277.        OTHER See xyDebug.
  1278.  
  1279.  
  1280.  
  1281.       +----------------+--------------------------------------------------+
  1282.       | xyGetParameter | Retrieves driver parameter.                      |
  1283.       +----------------+--------------------------------------------------+
  1284.  
  1285.       SYNTAX function xyGetParameter(Port,Parameter:Integer):LongInt;
  1286.              (* Port      : Port Selected. *)
  1287.              (* Parameter : Parameter to return. *)
  1288.  
  1289.       REMARK The driver parameter corresponding to the following table is
  1290.              returned.
  1291.  
  1292.                        Parameter :  Description
  1293.                XY_GET_ERROR_CODE : Driver error code (see XYDRIVER.PAS)
  1294.               XY_GET_ERROR_STATE : Error state (if in error).
  1295.                    XY_GET_PACKET : Current packet number.
  1296.                     XY_GET_STATE : Current state (XYDRIVER.C).
  1297.                 XY_GET_FILE_SIZE : File size.
  1298.                  XY_GET_NBR_NAKS : Number of packets ACKed.
  1299.                  XY_GET_LAST_GET : Last incoming (serial) character.
  1300.                  XY_GET_LAST_PUT : Last outgoing (serial) character.
  1301.                 XY_GET_GET_COUNT : Number of incoming characters (bytes).
  1302.                 XY_GET_PUT_COUNT : Number of outgoing characters (bytes).
  1303.              XY_GET_DRIVER_COUNT : Number times xyDriver() was called.
  1304.                               -1 : Cannot recognize parameter.
  1305.  
  1306.              The xyGetParameter function can be used to check the state of
  1307.              the driver. For example:
  1308.  
  1309.             (1) xyGetParameter(Port,XY_GET_STATE) returns XY_IDLE if idle.
  1310.             (2) xyGetParameter(Port,XY_GET_ERROR_CODE) returns the driver
  1311.                 error code if an error has occurred or XY_NO_ERROR (0)
  1312.                 otherwise.
  1313.  
  1314.       RETURN See above.
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.      WSC4D Reference Manual                                    Page 22
  1321.  
  1322.       +-----------+-------------------------------------------------------+
  1323.       | xyRelease | Releases driver port.                                 |
  1324.       +-----------+-------------------------------------------------------+
  1325.  
  1326.       SYNTAX function xyRelease(Port:Integer):Integer;
  1327.              (* Port : Port selected. *)
  1328.  
  1329.       REMARK The xyRelease function releases a port that was previously
  1330.              acquired with xyAcquire. This function should be called before
  1331.              calling the WSC function SioDone.
  1332.  
  1333.       RETURN  0 : No error (XY_NO_ERROR).
  1334.              <0 : XYDRIVER error. See .XYDRIVER Error Codes..
  1335.  
  1336.        OTHER See xyAcquire.
  1337.  
  1338.  
  1339.       +-----------+-------------------------------------------------------+
  1340.       | xyStartRx | Start XMODEM or YMODEM receive.                       |
  1341.       +-----------+-------------------------------------------------------+
  1342.  
  1343.       SYNTAX function xyStartRx(Port:Integer;Filename:PChar;
  1344.                                   NCGchar:Char;Batch:Integer):Integer;
  1345.              (* Port     : Port to use. *)
  1346.              (* Filename : File to receive (XMODEM only). *)
  1347.              (* NCGchar  : NAK, 'C', or 'G'. *)
  1348.              (* Batch    : YMODEM flag (T/F). *)
  1349.  
  1350.       REMARK The xyStartRx starts the XMODEM or YMODEM file receive. Once
  1351.              started, calls to xyDriver are made to execute the next state
  1352.              (or states). The xyStartTx function returns immediately.
  1353.  
  1354.              The protocols supported and their parameters are as follows:
  1355.  
  1356.              Protocol   :  NCGchar   BatchFlag  :  Comments
  1357.              XMODEM     :   NAK        FALSE       Standard XMODEM
  1358.              XMODEM/CRC :   'C'        FALSE
  1359.              XMODEM/1K  :   'C'        FALSE
  1360.              YMODEM     :   'C'        TRUE        Standard YMODEM
  1361.  
  1362.              The xyStart function is used to receive a file using XMODEM or
  1363.              YMODEM.
  1364.  
  1365.       RETURN =0 : No error (XY_NO_ERROR).
  1366.              <0 : Driver error. See .XYDRIVER Error Codes. a list of errors.
  1367.  
  1368.        OTHER See xyStartTx and xyDriver.
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.      WSC4D Reference Manual                                    Page 23
  1381.  
  1382.       +-----------+-------------------------------------------------------+
  1383.       | xyStartTx | Start XMODEM or YMODEM transmit.                      |
  1384.       +-----------+-------------------------------------------------------+
  1385.  
  1386.       SYNTAX function xyStartTx(Port:Integer;Filename:PChar;OneK:Integer;
  1387.                                   Batch:Integer);
  1388.              (* Port     : Port to use. *)
  1389.              (* Filename : File to send. *)
  1390.              (* OneK     : Want 1K blocks (T/F). *)
  1391.              (* Batch    : YMODEM flag (T/F). *)
  1392.  
  1393.       REMARK The xyStartTx starts the XMODEM or YMODEM file send. Once
  1394.              started, calls to xyDriver are made to execute the next state
  1395.              (or states). The xyStartTx function returns immediately.
  1396.  
  1397.              The protocols supported and their parameters are as follows:
  1398.  
  1399.              Protocol   :  OneKflag  BatchFlag : Comments
  1400.              XMODEM     :   FALSE      FALSE     Standard XMODEM
  1401.              XMODEM/CRC :   FALSE      FALSE
  1402.              XMODEM/1K  :   TRUE       FALSE
  1403.              YMODEM     :   TRUE       TRUE      Standard YMODEM
  1404.  
  1405.       RETURN =0 : No error (XY_NO_ERROR).
  1406.              <0 : Driver error. See XYDRIVER.PAS for a list of errors.
  1407.  
  1408.        OTHER See xyStartRx and xyDriver.
  1409.  
  1410.                          XYDRIVER Error Codes
  1411.  
  1412.       Error codes are always negative, except for 'no error'. Most of these
  1413.       error conditions rarely occur. Also note that XYDRIVER functions can
  1414.       return WSC errors. An error message is queued when an error occurs
  1415.       which can be retrieved with xyGetMessage.
  1416.  
  1417.       The numeric values for error codes can be found in XYDRIVER.PAS.
  1418.  
  1419.       +--------------------------+----------------------------------------+
  1420.       |              XY_NO_ERROR | No error. (0)                          |
  1421.       |         XY_UNKNOWN_ERROR | Unknown error.                         |
  1422.       |  XY_ALREADY_ACTIVE_ERROR | Port already acquired.                 |
  1423.       |     XY_CANNOT_OPEN_ERROR | Cannot open specified file.            |
  1424.       |      XY_EMPTY_FILE_ERROR | Specified file is empty.               |
  1425.       | XY_NO_STARTUP_CHAR_ERROR | Must specify NAK, 'C', or 'G'.         |
  1426.       |         XY_NOT_NCG_ERROR | Expected NAK, 'C', or 'G'.             |
  1427.       |       XY_DISK_READ_ERROR | Error reading disk.                    |
  1428.       |      XY_NO_EOT_ACK_ERROR | EOT was not ACKed.                     |
  1429.       |        XY_INTERNAL_ERROR | Internal error!                        |
  1430.       |       XY_CANCELLED_ERROR | Other side canceled.                   |
  1431.       |     XY_OUT_OF_SYNC_ERROR | Protocol has lost synchronization.     |
  1432.       |         XY_RETRIES_ERROR | Packet retry limit was exceeded.       |
  1433.       |  XY_BAD_PACKET_NBR_ERROR | Incorrect packet number.               |
  1434.       |       XY_TIMED_OUT_ERROR | Timed out waiting for other side.      |
  1435.       |    XY_NO_SUCH_FILE_ERROR | No such file.                          |
  1436.       |      XY_NOT_ACTIVE_ERROR | Port not acquired by xyAcquire.        |
  1437.       |      XY_PORT_RANGE_ERROR | Port number out of range.              |
  1438.       +--------------------------+----------------------------------------+
  1439.  
  1440.      WSC4D Reference Manual                                    Page 24
  1441.  
  1442.